<template>
	<view>
		<!-- list -->
		<view class="margin">
			<view class="" v-if="messageList.length">
				<block v-for="(item, index) in messageList" :key="index">
					<view class="item" :key="index" style="height: 130rpx" @click="goGroup(item)">
						<u-row gutter="10">
							<u-col span="3">
								<u-avatar :src="item.xtGroupUrl"></u-avatar>
							</u-col>
							<u-col span="8">
								<view class="flex-column text-left">
									<view class="size_18 text-bold">
										{{ item.xtGroupName }}
									</view>
								</view>
							</u-col>
						</u-row>
					</view>
				</block>
			</view>
			<u-empty mode="list" v-else> </u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			messageList: {
				type: Array,
				required: true
			}
		},
		data() {
			return {
				// messageList: [],
				options1: [{
					text: "删除",
					style: {
						backgroundColor: "#f56c6c",
					},
				}, ],
			};
		},
		mounted() {
		},
		methods: {
			goGroup(item) {
				let data = {
					"groupId": item.xtTeamId,
					"sessageName": item.xtGroupName,
					"userId": item.xtUserGroup,
					"avatar": item.xtGroupUrl
				}
				this.$pub.go(`/pages_message/chatGroup/chatGroup?data=${encodeURIComponent( JSON.stringify(data))}`);
			},
			deleteItem(e) {
				console.log(e, "e");
				let index = e.index;
				this.messageList.splice(index, 1);
			},
		},
		onShow() {
		},
	};
</script>

<style lang="scss" scoped>

</style>